<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1.箭头函数语法 
        /*
        let 函数名=（参数）=>{}
        */
        let abc = (x, y) => {
            return x + y;
        }
        console.log(abc(10, 20));
        //2.只有一个形参可以省略小框号
        let a = x => {
            return x + x;
        }
        console.log(a(2));
        //3.如果函数体只有一行代码可以省略大框号 ，并且return 也不需要，但有return的效果
        let b = (x, y) => x + y;
        console.log(b(1, 1));

        //遍历数组
        [10, 20, 30, 40, 50, 60].forEach(item => {
            console.log(item);
        });
        var arr = [];
        var arr1 = [10, 20, 30, 40, 50, 60];
        arr1.forEach(item => arr.push(arr1));
        console.log(arr);
    </script>
</body>

</html>